package com.atguigu.day03.homework;

import java.sql.SQLOutput;
import java.util.Scanner;

public class HomeWork11 {
    public static void main(String[] args) {
        double discount;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入订单总价格:");
        double totalPrice = sc.nextDouble();
        if (totalPrice < 0) {
            System.out.println("您输入的价格有误");
        }else {
            if (totalPrice >= 500) {
                discount = 0.8;
            }else if (totalPrice >=400 && totalPrice < 500) {
                discount = 0.85;
            }else if (totalPrice >= 300 && totalPrice < 400) {
                discount = 0.9;
            }else if (totalPrice >= 200 && totalPrice < 300) {
                discount = 0.95;
            }else{
                discount = 1;
            }

            System.out.println("您最终的价格是" + (totalPrice *= discount));
        }

        sc.close();
    }
}
